package com.cmc.cloud.cmclink.doc.api.document.rep;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List;

@Schema(description = "管理后台 - 提单主信息创建 Request VO")
@Data
@EqualsAndHashCode()
@AllArgsConstructor
@NoArgsConstructor
@ToString()
@Valid
public class BlnoNumericalContainerRespDto {

    @Schema(description = "船名代码")
    private String vesselCode;
    @Schema(description = "出口航次")
    private String voyage;
    @Schema(description = "航线代码")
    private String laneCode;
    @Schema(description = "pol港口")
    private String polCode;
    @Schema(description = "pod港口")
    private String podCode;
    @Schema(description = "ETD ETA 时间")
    private String etdEta;
    @Schema(description = "分区信息")
    private List<NumericalContainerInfo> numericalContainerList;
    @Schema(description = "统计信息 All")
    private CountInfo countAllInfo;

    @Data
    public static class NumericalContainerInfo {
        @Schema(description = "港口信息")
        private String portCode;
        @Schema(description = "主列表信息")
        private List<BaseInfo> infoList;
        @Schema(description = "统计信息")
        private CountInfo countInfo;
    }

    @Data
    public static class BaseInfo {
        /**
         * 箱号
         */
        private String cntrNo;
        /**
         * 铅封号
         */
        private String sealNo;

        /**
         * 箱型
         */
        private String cntrType;
        /**
         * 尺寸
         */
        private String cntrSize;

        private String blNo;

        /**
         * (No. & kind of Packages) 包装与件数
         */
        private String noofpkgs;

        private String contents;
        /**
         * 每个箱子的货物毛重
         */
        private BigDecimal netWt;
        /**
         * 箱皮重
         */
        private BigDecimal cntrTare;
        /**
         * 每个箱子的货物毛重+箱子的皮重
         */
        private BigDecimal grossWt;
        /**
         * 箱尺寸+箱型，如果箱型是 GP 箱不显示箱型只显示尺寸。
         * 冷箱 箱尺寸+箱型 货类:温度
         * 危险品  箱尺寸+箱型 货类:UNNO/IMO Class
         */
        private String remark;

        private String cntrStatus;
    }

    @Data
    public static class CountInfo {
        @Schema(description = "net 单个统计信息")
        List<WgtInfo> netWtList;
        @Schema(description = "gross 单个统计信息")
        List<WgtInfo> grossWtList;
        @Schema(description = "net 统计信息")
        BigDecimal totalNetWt;
        @Schema(description = "gross 统计信息")
        BigDecimal totalGrossWt;
        @Schema(description = "箱型统计信息")
        List<CntrInfo> cntrList;
        @Schema(description = "提单数量统计")
        Long blnoCount;
        @Schema(description = "TEU")
        Long teuCount;
    }

    @Data
    public static class WgtInfo {
        private String cntrSize;

        private Integer cntrQuantity;

        private BigDecimal weight;
    }

    @Data
    public static class CntrInfo {
        private String cntrSizeType;

        private String cntrStatus;

        private Integer cntrQuantity;
    }

}
